// @FileName  :subtract.c
// @Time      :2024/3/1 10:21
// @Author    :YKW
//# include <bits/stdc++.h>
//using namespace std;
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# include <string.h>
# include <stdlib.h>

char s1[10086], s2[10086];
int n1[10086], n2[10086], ans[10086];

void char2int(char *s, int a[]) {
    int len = strlen(s);
    for (int i = len - 1, j = 0; i >= 0; i--, j++)
        a[j] = s[i] - '0';
}

int main() {
    gets(s1);
    gets(s2);
    char *p1, *p2;
    if (strcmp(s1, s2) == 0 || (strlen(s1) > strlen(s2)) || (strlen(s1) == strlen(s2) && strcmp(s1, s2) == 1))
        p1 = s1, p2 = s2;
    else p1 = s2, p2 = s1, printf("-");
    char2int(p1, n1);
    char2int(p2, n2);
    int len = strlen(p1);
    for (int i = 0; i < len; i++) {
        ans[i] = n1[i] - n2[i];
        if (ans[i] < 0) ans[i] += 10, n1[i + 1]--;
    }
    int flag = 0;
    for (int i = len - 1; i >= 0; i--) {
        if (ans[i] != 0) flag = 1;
        if (flag == 1) printf("%d", ans[i]);
    }
    if (flag == 0) printf("0");
    printf("\n");
    return 0;
}